package lab02.Test02;

import java.util.Random;
import java.util.Scanner;
import java.util.concurrent.Callable;

/**
 * Created by lenovo on 2017/10/13.
 */
public class Circle {
    //1.属性



    //2.行为
    public double area(double r){
        double area;
        area=Math.PI*r*r;
        return area;
    }

    public double perimeter(double r){
        double perimeter;
        perimeter = 2*Math.PI*r;
        return perimeter;
    }
    //3.构造函数



    public static void main(String[] args) {
        Circle circles=new Circle();
        System.out.println("请输入半径：");
        Scanner sc=new Scanner(System.in);
        double Sc= Double.parseDouble(sc.next());
        System.out.printf("面积为："+circles.area(Sc));
        System.out.println("周长为："+circles.perimeter(Sc));
    }

}
